using System.Text;

namespace ViScript.Core.Blocks
{
    public class NormalBlock : IBlock
    {
        private readonly StringBuilder stringBuilder = new StringBuilder();

        public string Escape()
        {
            return stringBuilder.ToString();
        }

        public string Unescape()
        {
            return stringBuilder.ToString();
        }

        public void Append(char c)
        {
            stringBuilder.Append(c);
        }

        public bool ShouldAppendQuotedBlock(char c)
        {
            return IsQuotationMark(c);
        }

        private static bool IsQuotationMark(char c)
        {
            if (c == '"')
            {
                return true;
            }
            return c == '\'';
        }
    }
}